{extend name="base" /}
{block name="body"}

<div class="blog-content">
    <div id="fh5co-blog-section">
        <div class="container">
            <div class="row">
                <div class="col-md-6 col-md-offset-3 text-center fh5co-heading">
                    <h2>添加blog</h2>
                    <p><span>Created with <i class="sl-icon-heart"></i> xiayulei <a href="https://github.com/xiayulei/think_admin">github</a></span></p>
                </div>
            </div>




            <form class="layui-form form-container" action="{:url('admin/article/save')}" method="post">


                <div class="layui-form-item">
                    <label class="layui-form-label">标题</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" value="" required  lay-verify="required" placeholder="请输入标题" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">作者</label>
                    <div class="layui-input-block">
                        <input type="text" name="author" value="" placeholder="（选填）请输入作者" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">简介</label>
                    <div class="layui-input-block">
                        <textarea name="introduction" placeholder="（选填）请输入简介" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">内容</label>
                    <div class="layui-input-block">
                        <textarea name="content" placeholder="" class="layui-textarea" id="content"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">缩略图</label>
                    <div class="layui-input-block">
                        <input type="text" name="thumb" value="" class="layui-input layui-input-inline" id="thumb">
                        <input type="file" name="file" class="layui-upload-file">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">图集</label>
                    <div class="layui-input-block">
                        <button type="button" id="upload-photo-btn" class="layui-btn">上传图集</button>
                        <div id="photo-container"></div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" value="1" title="已审核" checked="checked">
                        <input type="radio" name="status" value="0" title="未审核">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">置顶</label>
                    <div class="layui-input-block">
                        <input type="radio" name="is_top" value="1" title="置顶">
                        <input type="radio" name="is_top" value="0" title="未置顶" checked="checked">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">推荐</label>
                    <div class="layui-input-block">
                        <input type="radio" name="is_recommend" value="1" title="推荐">
                        <input type="radio" name="is_recommend" value="0" title="未推荐" checked="checked">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">发布时间</label>
                    <div class="layui-input-block">
                        <input type="text" name="publish_time" value="{:time()}" class="layui-input datetime">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">排序</label>
                    <div class="layui-input-block">
                        <input type="text" name="sort" value="0" required  lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="*">保存</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>





            {foreach name="results" item="result"}

            <div class="blog-inner">
                <img style="margin: auto;" class="img-responsive" src="{$result.thumb}" alt="Blog">
                <div class="desc">
                    <h3>{$result.title}</h3>

                    <p>{$result.content}</p>
                </div>
            </div>
            {/foreach}


        </div>
    </div>

</div>



{/block}